// result.js
const { getMockData } = require('../../utils/data.js')
Page({
  data: {
    type: '',
    period: 0,
    result: {}
  },
  onLoad: function (options) {
    const { type, period } = options
    this.setData({ type, period })
    this.loadResult(type, period)
  },
  loadResult: function (type, period) {
    // 这里应该是从服务器获取数据，现在用模拟数据代替
    const mockData = getMockData(type, period)
    this.setData({ result: mockData })
  }
})
